package ae.pcfc.etks.online.itworx.ehs.web.exception;

import ae.pcfc.etks.online.itworx.ehs.web.common.exception.BaseException;
import ae.pcfc.etks.online.itworx.ehs.web.model.Rollback;

/**
 * the concrete class of the exception that must be thrown by any EHS class
 * 
 * @author Ahmed.Mostafa
 * 
 */
public class ValidationException extends Exception implements BaseException {

	private static final long serialVersionUID = 1L;

	private Rollback rollbackBean = null;
	private String errorCode = null;

	public ValidationException() {
		super();
	}

	public ValidationException(final String message) {
		super(message);
	}

	public ValidationException(final Throwable throwable) {
		super(throwable);
	}

	public ValidationException(final String message, final Throwable throwable) {
		super(message, throwable);
	}

	public ValidationException(final Rollback rollbackBean) {
		super(rollbackBean.toString());
		setErrorRollbackBean(rollbackBean);
	}

	@Override
	public void setErrorRollbackBean(Rollback rollbackBean) {
		this.rollbackBean = rollbackBean;
	}

	@Override
	public Rollback getErrorRollbackBean() {
		return rollbackBean;
	}

	@Override
	public String getErrorCode() {
		return errorCode;
	}

	@Override
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;

	}
}